package com.shanglv.web.action.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.shanglv.dto.flight.demo.DemoDto;
import com.shanglv.web.proxy.demo.DemoProxy;

@Controller
@RequestMapping("/demos")
public class DemoController {
	
	@Autowired
	private DemoProxy demoProxy;

	@RequestMapping(value="/index.html", method = RequestMethod.GET)
	public String index(Model model){
		DemoDto dto = demoProxy.getDemoById(1);
		
		model.addAttribute("demo", dto);
		return "demo/index";
	}
}
